from os import PathLike
from typing import Callable

class LCM:
    def __init__(self, provider: str | None = None) -> None: ...
    def fileno(self) -> int: ...
    def handle(self) -> None: ...
    def handle_timeout(self, timeout_millis: int) -> int: ...
    def publish(self, channel: str, data: bytes) -> None: ...
    def subscribe(
        self, channel: str, callback: Callable[[str, bytes], None]
    ) -> LCMSubscription: ...
    def unsubscribe(self, subscription_object: LCMSubscription) -> None: ...

class LCMSubscription:
    def __init__(self) -> None: ...
    def set_queue_capacity(self, num_messages: int) -> None: ...

class Event:
    data: bytes
    channel: str
    eventnum: int
    timestamp: int
    def __init__(
        self, eventnum: int, timestamp: int, channel: str, data: bytes
    ) -> None: ...

class EventLog:
    mode: str
    def __init__(
        self, path: str | PathLike[str], mode: str = "r", overwrite: bool = False
    ) -> None: ...
    def close(self) -> None: ...
    def next(self) -> Event: ...
    def read_next_event(self) -> Event: ...
    def seek(self, filepos: int) -> None: ...
    def seek_to_timestamp(self, timestamp: int) -> None: ...
    def size(self) -> int: ...
    def tell(self) -> int: ...
    def write_event(self, utime: int, channel: str, data: bytes) -> None: ...

LCM_BIN_DIR: str = ...

def run_script(name: str, args: list[str]) -> int: ...
def run_example() -> None: ...
def run_gen() -> None: ...
def run_logfilter() -> None: ...
def run_logger() -> None: ...
def run_logplayer() -> None: ...
def run_logplayer_gui() -> None: ...
def run_sink() -> None: ...
def run_source() -> None: ...
def run_spy() -> None: ...
def run_tester() -> None: ...
